'use strict'

define(['jquery', 'bootstrap', 'select2'], function($) {
  
  return {
        
    init: function(data) {
        this.initPage();
    },
    
    initPage: function(status){
    	$('select[name="site"]').select2({
            minimumResultsForSearch : -1,
            allowClear : true,
            width: '150'
          });

          $('select[name="site"]').change(function(){ 

            var site = $(this).children('option:selected').val();
            window.location.href = window.__CTX__.root + "/student-reports?site=" + site;

          })
    }
    
  }
})
